1 <?php
2 session_start();
3 error_reporting(
0);
4 include(
'includes/config.php');
5 if
(strlen($_SESSION['alogin'])==0)
6     {
7 header(
'location:index.php');
8 }

9 else
{
10     
// code for cancel
11 if
(isset($_REQUEST['bkid']))
12     {
13 $bid=intval($_GET[
'bkid']);
14 $status=
2;
15 $cancelby=
'a';
16 $sql =
"UPDATE tblbooking SET status=:status,CancelledBy=:cancelby WHERE BookingId=:bid";
17 $query = $dbh->prepare($sql);
18 $query -> bindParam(
':status',$status, PDO::PARAM_STR);
19 $query -> bindParam(
':cancelby',$cancelby , PDO::PARAM_STR);
20 $query-> bindParam(
':bid',$bid, PDO::PARAM_STR);
21 $query -> execute();
22
23 $msg=
"Booking Cancelled successfully";
24 }

25
26
27 if
(isset($_REQUEST['bckid']))
28     {
29 $bcid=intval($_GET[
'bckid']);
30 $status=
1;
31 $cancelby=
'a';
32 $sql =
"UPDATE tblbooking SET status=:status WHERE BookingId=:bcid";
33 $query = $dbh->prepare($sql);
34 $query -> bindParam(
':status',$status, PDO::PARAM_STR);
35 $query-> bindParam(
':bcid',$bcid, PDO::PARAM_STR);
36 $query -> execute();
37 $msg=
"Booking Confirm successfully";
38 }
39
40
41
42
43     ?>
44 <!DOCTYPE HTML>
45 <html>
46 <head>
47 <title>TMS | Admin manage Bookings</title>
48 <meta name=
"viewport" content="width=device-width, initial-scale=1">
49 <meta http-equiv=
"Content-Type" content="text/html; charset=utf-8" />
50 <script type=
"application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
51 <link href=
"css/bootstrap.min.css" rel='stylesheet' type='text/css' />
52 <link href=
"css/style.css" rel='stylesheet' type='text/css' />
53 <link rel=
"stylesheet" href="css/morris.css" type="text/css"/>
54 <link href=
"css/font-awesome.css" rel="stylesheet">
55 <script src=
"js/jquery-2.1.4.min.js"></script>
56 <link rel=
"stylesheet" type="text/css" href="css/table-style.css" />
57 <link rel=
"stylesheet" type="text/css" href="css/basictable.css" />
58 <script type=
"text/javascript" src="js/jquery.basictable.min.js"></script>
59 <script type=
"text/javascript">
60     $(document).ready(function() {
61       $(
'#table').basictable();
62
63       $(
'#table-breakpoint').basictable({
64         breakpoint:
768
65       });
66
67       $(
'#table-swap-axis').basictable({
68         swapAxis:
true
69       });
70
71       $(
'#table-force-off').basictable({
72         forceResponsive:
false
73       });
74
75       $(
'#table-no-resize').basictable({
76         noResize:
true
77       });
78
79       $(
'#table-two-axis').basictable();
80
81       $(
'#table-max-height').basictable({
82         tableWrapper:
true
83       });
84     });
85 </script>
86 <link href=
'//fonts.googleapis.com/css?family=Roboto:700,500,300,100italic,100,400' rel='stylesheet' type='text/css'/>
87 <link href=
'//fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
88 <link rel=
"stylesheet" href="css/icon-font.min.css" type='text/css' />
89   <style>
90         .errorWrap {
91     padding: 10px;
92     margin:
0 0 20px 0;
93     background: #fff;
94     border-left: 4px solid #dd3d36;
95     -webkit-box-shadow:
0 1px 1px 0 rgba(0,0,0,.1);
96     box-shadow:
0 1px 1px 0 rgba(0,0,0,.1);
97 }
98 .succWrap{
99     padding: 10px;
100     margin:
0 0 20px 0;
101     background: #fff;
102     border-left: 4px solid #5cb85c;
103     -webkit-box-shadow:
0 1px 1px 0 rgba(0,0,0,.1);
104     box-shadow:
0 1px 1px 0 rgba(0,0,0,.1);
105 }
106         </style>
107 </head>
108 <body>
109    <div
class="page-container">
110    <!--/content-inner-->
111 <div
class="left-content">
112        <div
class="mother-grid-inner">
113             <!--header start here-->
114                 <?php include(
'includes/header.php');?>
115                      <div
class="clearfix"> </div>
116                 </div>
117 <!--heder end here-->
118 <ol
class="breadcrumb">
119                 <li
class="breadcrumb-item"><a href="index.html">Home</a><i class="fa fa-angle-right"></i>Manage Bookings</li>
120             </ol>
121 <div
class="agile-grids">
122                 <!-- tables -->
123                 <?php
if($error){?><div class="errorWrap"><strong>ERROR</strong>:<?php echo htmlentities($error); ?> </div><?php }
124                 
else if($msg){?><div class="succWrap"><strong>SUCCESS</strong>:<?php echo htmlentities($msg); ?> </div><?php }?>
125                 <div
class="agile-tables">
126                     <div
class="w3l-table-info">
127                       <h2>Manage Bookings</h2>
128                         <table id=
"table">
129                         <thead>
130                           <tr>
131                           <th>Booikn id</th>
132                             <th>Name</th>
133                             <th>Mobile No.</th>
134                             <th>Email Id</th>
135                             <th>RegDate </th>
136                             <th>From /To </th>
137                             <th>Comment </th>
138                             <th>Status </th>
139                             <th>Action </th>
140                           </tr>
141                         </thead>
142                         <tbody>
143 <?php $sql =
"SELECT tblbooking.BookingId as bookid,tblusers.FullName as fname,tblusers.MobileNumber as mnumber,tblusers.EmailId as email,tbltourpackages.PackageName as pckname,tblbooking.PackageId as pid,tblbooking.FromDate as fdate,tblbooking.ToDate as tdate,tblbooking.Comment as comment,tblbooking.status as status,tblbooking.CancelledBy as cancelby,tblbooking.UpdationDate as upddate from tblusers join tblbooking on tblbooking.UserEmail=tblusers.EmailId join tbltourpackages on tbltourpackages.PackageId=tblbooking.PackageId";
144 $query = $dbh -> prepare($sql);
145 $query->execute();
146 $results=$query->fetchAll(PDO::FETCH_OBJ);
147 $cnt=
1;
148 if
($query->rowCount() > 0)
149 {

150 foreach
($results as $result)
151 { ?>
152                           <tr>
153                             <td>#BK-<?php echo htmlentities($result->bookid);?></td>
154                             <td><?php echo htmlentities($result->fname);?></td>
155                             <td><?php echo htmlentities($result->mnumber);?></td>
156                             <td><?php echo htmlentities($result->email);?></td>
157                             <td><a href=
"update-package.php?pid=<?php echo htmlentities($result->pid);?>"><?php echo htmlentities($result->pckname);?></a></td>
158                             <td><?php echo htmlentities($result->fdate);?> To <?php echo htmlentities($result->tdate);?></td>
159                                 <td><?php echo htmlentities($result->comment);?></td>
160                                 <td><?php
if($result->status==0)
161 {
162 echo
"Pending";
163 }

164 if
($result->status==1)
165 {
166 echo
"Confirmed";
167 }

168 if
($result->status==2 and $result->cancelby=='a')
169 {
170 echo
"Canceled by you at " .$result->upddate;
171 }

172 if
($result->status==2 and $result->cancelby=='u')
173 {
174 echo
"Canceled by User at " .$result->upddate;
175
176 }
177 ?></td>
178
179 <?php
if($result->status==2)
180 {
181     ?><td>Cancelled</td>
182 <?php }
else {?>
183 <td><a href=
"manage-bookings.php?bkid=<?php echo htmlentities($result->bookid);?>" onclick="return confirm('Do you really want to cancel booking')" >Cancel</a> / <a href="manage-bookings.php?bckid=<?php echo htmlentities($result->bookid);?>" onclick="return confirm('Do you really want to cancel booking')" >Confirm</a></td>
184 <?php }?>
185
186                           </tr>
187                          <?php $cnt=$cnt+
1;} }?>
188                         </tbody>
189                       </table>
190                     </div>
191                   </table>
192
193                 
194             </div>
195 <!-- script-
for sticky-nav -->
196         <script>
197         $(document).ready(function() {
198              
var navoffeset=$(".header-main").offset().top;
199              $(window).scroll(function(){
200                 
var scrollpos=$(window).scrollTop();
201                 
if(scrollpos >=navoffeset){
202                     $(
".header-main").addClass("fixed");
203                 }
else{
204                     $(
".header-main").removeClass("fixed");
205                 }
206              });
207              
208         });
209         </script>
210         <!-- /script-
for sticky-nav -->
211 <!--inner block start here-->
212 <div
class="inner-block">
213
214 </div>
215 <!--inner block end here-->
216 <!--copy rights start here-->
217 <?php include(
'includes/footer.php');?>
218 <!--COPY rights end here-->
219 </div>
220 </div>
221   <!--
//content-inner-->
222         <!--/sidebar-menu-->
223                         <?php include(
'includes/sidebarmenu.php');?>
224                               <div
class="clearfix"></div>
225                             </div>
226                             <script>
227                             
var toggle = true;
228                                         
229                             $(
".sidebar-icon").click(function() {
230                               
if (toggle)
231                               {
232                                 $(
".page-container").addClass("sidebar-collapsed").removeClass("sidebar-collapsed-back");
233                                 $(
"#menu span").css({"position":"absolute"});
234                               }
235                               
else
236                               {
237                                 $(
".page-container").removeClass("sidebar-collapsed").addClass("sidebar-collapsed-back");
238                                 setTimeout(function() {
239                                   $(
"#menu span").css({"position":"relative"});
240                                 },
400);
241                               }
242                                             
243                                             toggle = !toggle;
244                                         });
245                             </script>
246 <!--js -->
247 <script src=
"js/jquery.nicescroll.js"></script>
248 <script src=
"js/scripts.js"></script>
249 <!-- Bootstrap Core JavaScript -->
250    <script src=
"js/bootstrap.min.js"></script>
251    <!-- /Bootstrap Core JavaScript -->
252
253 </body>
254 </html>
255 <?php } ?>


Gõ tìm kiếm nhanh...